<?php
/**
 * 产品库模型
 */
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Models\Traits\BaseModel;
use Illuminate\Database\Eloquent\SoftDeletes;

class Product extends Model
{

    use BaseModel; //基础模型
    use SoftDeletes; //软删除
    //数据表名称
    protected $table = 'products';
    //没有主键ID
    protected $itemName = '产品库';
    //批量赋值白名单
    protected $fillable = [
       'description',
       'st_num',
       'st_coding',
       'st_name',
       'st_img',
       'st_asin',
       'st_sku',
       'st_label',
       'st_upc',
       'st_status',
       'st_stocks',
       'st_weight',
       'st_size',
       'st_head_cash',
       'st_cash',
       'st_is_small',
       'st_product_status',
       'st_fnsku',
       'st_english',
       'st_country',
       'st_m_price',
       'st_fba_cost',
       'st_profit',
       'st_profit_ratio',
       'st_is_repertory',
       'st_shop_id',
       'st_is_compose'
    ];
    //输出隐藏字段
    protected $hidden = ['deleted_at'];
    //日期字段
    protected $dates = ['created_at','updated_at','deleted_at'];
    //字段值map
    protected $fieldsShowMaps = [];
    //字段默认值
    protected $fieldsDefault = [
        'st_num' => 0,
        'st_coding' => '',
        'st_name' => '',
        'st_img' => '',
        'st_asin' => '',
        'st_sku' => '',
        'st_label' => '',
        'st_upc' => '',
        'st_status' => 0,
        'st_stocks' => 0,
        'st_weight' => 0,
        'st_size' => '',
        'st_head_cash' => 0.00,
        'st_cash' => 0.00,
        'st_is_small' => 0,
        'st_product_status' => 0,
        'st_fnsku' => '',
        'st_english' => '',
        'st_country' => '',
        'st_m_price' => 0.00,
        'st_fba_cost' => 0.00,
        'st_profit' => 0.00,
        'st_profit_ratio' => 0.00,
        'st_is_repertory' => 2,
        'st_shop_id' => 0,
        'st_is_compose' => 0
    ];
    //字段说明
    protected $fieldsName = [
        'id' => 'ID',
        'description' => '备注',
        'created_at' => '创建时间',
        'updated_at' => '修改时间',
        'deleted_at' => '删除时间',
        'st_num' => '数量',
        'st_coding' => '内部编码id',
        'st_name' => '产品名',
        'st_img' => '产品图片',
        'st_asin' => '产品Asin',
        'st_sku' => '产品SKU',
        'st_label' => '标签码地址',
        'st_upc' => 'UPS',
        'st_status' => '产品状态 0-未审核 101-审核通过 301-审核未通过',
        'st_stocks' => '库存',
        'st_weight' => '产品重量 g为单位',
        'st_size' => '产品尺寸 cm为单位',
        'st_head_cash' => '头程费用',
        'st_cash' => '采购成本',
        'st_is_small' => '是否轻小件 1-是 2-否',
        'st_product_status' => '产品状态 300-在售 301-新品 302-停售',
        'st_fnsku' => '产品fnsku',
        'st_english' => '英文关键词',
        'st_country' => '国家 站点',
        'st_m_price' => '新品定价',
        'st_fba_cost' => 'fba费用',
        'st_profit' => '利润',
        'st_profit_ratio' => '利润率',
        'st_is_repertory' => '是否有库存',
        'st_shop_id' => '店铺id',
        'st_is_compose' => '是否是组合 默认0 不是 1是组合'
    ];




}
